<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    <script type="text/javascript">
        var time1=Date.now()
        window.setTimeout(function(){
            console.log('timeout 2222')
        },20000)
        
        timer=window.setTimeout(function(){
            console.log((Date.now()-time1)+'timeout 1111')
            },10000)
        function fn(){
            console.log('fn()')
        }
        fn()
        console.log('alert之前')
        alert('---------')
        console.log('alert之后')
        
        
        </script>
</body>
</html>